package com.itheima.thread14;

public class Desk {
    //定义一个标记
    //true 就表示桌子上面有蛋糕,吃货线程就可以启动了,
    //false 就表示桌子上面没有蛋糕,厨师线程就可以启动了,
    //public static boolean flag = false;
    private boolean flag;

    //定义一个桌子上面的蛋糕数量最多有几个
    //public static int count = 10;
    private  int count = 10;


    //定义锁对象
    //public static final Object lock = new Object();
    private final Object lock = new Object();

    public Desk() {
    }

    public Desk(boolean flag, int count) {
        this.flag = flag;
        this.count = count;
    }


    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Object getLock() {
        return lock;
    }

}
